﻿package net.wangit.jdbc.generator;

import net.wangit.framework.cache.Cache;
import net.wangit.framework.util.CacheUtil;

public class IncrementorCache {

	public IncrementorCache() {
	}

	public static Incrementor get(String domain, String incrementorId) {
		return (Incrementor) getCache(domain).get(incrementorId);
	}

	public static void put(String domain, String incrementorId,
			Incrementor incrementor) {
		getCache(domain).put(incrementorId, incrementor);
	}

	public static void clear(String domain, String incrementorId) {
		getCache(domain).clear(incrementorId);
	}

	public static void clearAll(String domain) {
		getCache(domain).clearAll();
	}

	private static Cache getCache(String domain) {
		return CacheUtil.getIncrementorCache(domain);
	}
}
